#include <iostream>
#include <string>
#include <list>
#include <deque>

int main()
{
    std::list<int> ilist;
    std::deque<int> que1, que2;

    ilist = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

    for(auto it = ilist.begin(); it != ilist.end(); it++)
    {
        if(*it % 2 != 0)
        // 可以使用 if( *it & 1) // 查看最低位：1 奇数; 0, 偶数
        {
            que1.push_back(*it);
        } 
        else
        {
            que2.push_front(*it);
        }
    }
    
    for(auto it : que1)
    {
        std::cout << it << " ";
    }
    std::cout << std::endl;

    for(auto it : que2)
    {
        std::cout << it << " ";
    }
    std::cout << std::endl;

    return 0;
}